home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Educational / TravelingSalesman / Traveling_Salesman.app / Salesman.nib (.txt) < prev    next >
NeXT TypedStream Data  |  1995-06-12  |  10KB  |  200 lines

  1. typedstream
  2. StreamTable
  3.     HashTable
  4. Object
  5. [20c]
  6. typedstream
  7. [915c]
  8. typedstream
  9.     HashTable
  10. Object
  11. PlotController
  12. HeaderClass
  13. %%%%i@@
  14. genericobject_nib
  15. theScrollView
  16. thePlotView
  17. FirstResponder
  18. firstnib
  19. checkSpelling:
  20. alignSelCenter:
  21.     unscript:
  22. pasteFont:
  23. runPageLayout:
  24. superscript:
  25. copyRuler:
  26.     copyFont:
  27. selectAll:
  28. pasteRuler:
  29. toggleRuler:
  30. showGuessPanel:
  31. alignSelLeft:
  32. paste:
  33. performClose:
  34. arrangeInFront:
  35. subscript:
  36. copy:
  37. alignSelRight:
  38. delete:
  39. orderFrontColorPanel:
  40. underline:
  41. performMiniaturize:
  42. PlotView
  43. viewnib
  44. crossCursor
  45. textCell
  46. points
  47. InitTemp
  48. Stop1
  49. delegate
  50. Iterations
  51. PathL
  52. Freeze
  53. CoolingOn:
  54. plot:
  55. Nuke:
  56. clear:
  57. DoRoute:
  58. CoolingOff:
  59. Stop:
  60. [9361c]
  61. typedstream
  62.     HashTable
  63. Object
  64. NXImage
  65. PlotterAppIcon
  66. NXBitmapImageRep
  67. NXImageRep
  68. iissss00
  69. [576c]
  70. UUUUUUUUUUG
  71. UUUUUUUUUUT
  72. UUUUUUUUUUT
  73. NibData
  74. @@@@s
  75. Storage
  76. {*@@}
  77.     [42{*@@}]
  78. File's Owner
  79. CustomObject
  80. Application
  81. MainMenu
  82. MenuTemplate
  83. *@*@ccc
  84. Salesman
  85. Matrix
  86. Control
  87.     Responder
  88. @:@iiii
  89. MenuCell
  90. ButtonCell
  91. ActionCell
  92. Info...
  93.     Helvetica
  94. Paste
  95. Select All
  96. ff@@#::s
  97. submenuAction:
  98. Bitmap
  99.     menuArrow
  100. Print
  101. Traveling Salesman
  102. WindowTemplate
  103. iiii***@s@
  104. Window
  105. [12@]
  106. ScrollView
  107. ClipView
  108. ciifffcfffs
  109. [157c]{\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;}
  110. \margl40
  111. \margr40
  112. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\f0\b0\i0\ul0\fs24 
  113. NXCursor
  114. NXibeam
  115. Scroller
  116. _doScroller:
  117. @@@ffs
  118. Button
  119. Plot cities
  120. Clear map 
  121.     TextField
  122. TextFieldCell
  123. Cities
  124. Helvetica-Bold
  125. CustomView
  126. PlotView
  127. Find & Show Route
  128. Break
  129.     Clear All
  130. NXradio
  131. NXradioH
  132. Radio
  133. FormCell
  134. Present Path length:
  135. Present Temperature:
  136. Initial Temperature:
  137. Test for Freezing:
  138. Trials Between Plottings:
  139. Field:
  140. Latent cooling
  141. ScrollingText
  142. Field2
  143. Field
  144. Field3
  145. Present Path length!
  146. Present Temperature&
  147. Initial Temperature*
  148. Test for Freezing.
  149. Trials Between Plottings2
  150. Field1:
  151. PlotControllerInstance
  152. PlotController
  153.  Info
  154. Panel
  155. ^This application interface uses Plotter, by Matt Morse,
  156. NeXT Technical Publications Department
  157. Times-Roman
  158. Traveling Salesman Problem
  159. ;Nolan R. Davis and Joseph Jeffery
  160. Naval Research Laboratory
  161. Times-BoldItalic
  162. %An Application of Simulated Annealing
  163. Times-Bold
  164. Button1_TOZTHcT
  165. Field4hT
  166. Field5mT
  167. Field6pT
  168. [2934c]{\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;}
  169. \margl40
  170. \margr40
  171. {\colortbl\red0\green0\blue0;}
  172. \pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f0\b0\i0\ul0\fs24\fc0 This application addresses the Traveling Salesman Problem, which requires that a salesman visiting N different cities find the shortest possible route that passes through each city once and only once. It uses Simulated Annealing, an algorithm for efficiently solving nonlinear optimization problems.  This problem is NP-complete:  The computation time increases exponentially as the number of cities increases.  For the Traveling Salesman Problem, there are (N-1)! /2 distinct routes to search. For example, with 14 cities, there are 3.1 billion routes. In this demonstration, Simulated Annealing can find a good solution usually within a few thousand trials. Although not guaranteed to get the best solution, Simulated Annealing will find a good one, which is often all one really needed, while saving a great deal of time. The above example is on the order of a million times faster than checking all possible routes.\
  173. The locations of the cities can be entered into the scroll view (Cities) or can be added to it by mouse clicking the map (maximum of 30 cities). When clicking on the map the cursor point whose coordinates appear just below the map can be dragged to whatever location on the map before being released and added to the list. An already existing city can be moved by clicking within its circle and dragging it.  When entering cities directly through the scroll view one must first display them using "Plot Cities" before one can find the route.\
  174. Initial Temperature and Test for Freezing are parameters used to control how the algorithm runs and the quality of the final path. Generally speaking, the higher these values the more optimal the final route and the longer needed to run.  As initial estimates, Initial Temperature is set at 5 times the initial path length, and Test is set at 10 times the number of cities.\
  175. In this application the default cooling schedule reduces the temperature inverse-proportionally to the number of iterations.  In addition, one can turn on a ``Latent Heat'' cooling schedule that allows the temperature to decrease based on changes in the path length [ Davis et al., ``An adaptive cooling schedule for simulated annealing with application to multiple-constraint time-domain beamforming'', J. Acoust. Soc. Am., Suppl. 1, Vol. 88 (1990)].  This cooling schedule has been found to have a nearly exponential cooling rate in spurts, and can significantly decrease the number of iterations required to reach a good solution.\
  176. Trials Between Plotting determines how often the intermediate trial routes will be plotted. Any negative number causes it to plot only the final route. Note the more you plot the slower it will run. Runs usually have several hundred to several thousand trials.
  177. {i*@@@}
  178. [25{i*@@@}]
  179. hide:
  180. terminate:
  181. copy:
  182. paste:
  183. selectAll:
  184. clear:
  185. plot:
  186. theScrollViewQ
  187. thePlotViewQ
  188. delegate
  189. makeKeyAndOrderFront:
  190. printPSCode:
  191. DoRoute:
  192. Nuke:    
  193. textCell
  194. PathL
  195. CoolingOn:
  196. Freeze
  197. InitTemp
  198. CoolingOff:
  199. Iterations
  200.